package director;

import structural.flyweight.Flyweight;
import structural.flyweight.FlyweightFactory;

public class FlyweightDirector {

    public static void main(String[] args) {
        for(int i=0;i<5;i++){
            Flyweight instance = FlyweightFactory.getInstance(i+"");
            System.out.println("获取到对象 type = "+ instance.getType());
        }

        System.out.println("==============================================");

        for(int i=0;i<10;i++){
            Flyweight instance = FlyweightFactory.getInstance(i+"");
            System.out.println("获取到对象 type = "+ instance.getType());
        }

    }
}
